// 后端拦截路由  所有拦截都在这个文件
const express = require('express')
const system = require('../ctrl/system')
const uni = require('../ctrl/uniapp/init')
const uniClient = require('../ctrl/uniapp/client')
const router = express.Router()
const uploadConfig = require('../utils/uploadConfig')
//陈玉
router.post('/noToken/login', system.login)

// 前台app
//--------------------------------消费者小程序---监护人终端
router.post('/uniClient/login', uniClient.login)
router.post('/uniClient/check', uniClient.check)
router.post('/uniClient/register', uniClient.register)

router.get('/uniClient/test', uniClient.test)

// -----搜索-------
router.post('/uniClient/serHistory', uniClient.serHistory)
router.post('/uniClient/delHistory', uniClient.delHistory)
router.post('/uniClient/addHistory', uniClient.addHistory)
router.post('/uniClient/delAll', uniClient.delAll)
router.get('/uniClient/getHot', uniClient.getHot)
router.post('/uniClient/getSearch', uniClient.getSearch)
// -------任务类别
router.get('/uniClient/getTaskType', uniClient.getTaskType)
// 商品详情

router.post('/uniClient/getTaskDetails', uniClient.getTaskDetails)

router.post('/uniClient/getTaskMsg', uniClient.getTaskMsg)

// ------购物车
router.post('/uniClient/getShopArr', uniClient.getShopArr)
router.post('/uniClient/delShopTask', uniClient.delShopTask)

// -------地址信息
router.post('/uniClient/getAddress', uniClient.getAddress)
router.post('/uniClient/addMyAddress', uniClient.addMyAddress)
router.post('/uniClient/editMyAddress', uniClient.editMyAddress)
router.post('/uniClient/changeDefault', uniClient.changeDefault)

router.post('/uniClient/delAdress', uniClient.delAdress)

// 用户的服务者信息
router.post('/uniClient/getServe', uniClient.getServe)

// 加入购物车
router.post('/uniClient/addShop', uniClient.addShop)
// 删除购物车（已加入的）
router.post('/uniClient/delTaskInfo', uniClient.delTaskInfo)

// 加入订单
router.post('/uniClient/addTaskInfo', uniClient.addTaskInfo)
// 获取订单
router.post('/uniClient/getOrderArr', uniClient.getOrderArr)

// ======个人信息
// 档案信息
router.post('/uniClient/getUserINfoArr', uniClient.getUserINfoArr)
// 查找修改人的信息
router.post('/uniClient/editGetUser', uniClient.editGetUser)
// 确认修改按钮
router.post('/uniClient/addConfirm', uniClient.addConfirm)
// 删除联系人档案
router.post('/uniClient/delRelation', uniClient.delRelation)
router.post('/uniClient/editConfirm', uniClient.editConfirm)
router.post('/uniClient/uploadTest', uniClient.uploadTest)
// 修改密码门
router.post('/uniClient/changePwd', uniClient.changePwd)

//陪护人终端

//后台管理端


// router.post('/system/getMenu', system.getMenu)
//单文件上传
router.post("/upload", uploadConfig.single("file"), (req, res) => {
    res.send(req.body.imgUrl);//上传成功之后  给客户端响应
})
module.exports = router